A method in which multiple images that include positional deviation are acquired, positioning of the plurality of images is carried out, and an interpolated image is generated by interpolation processing based on the plurality of images is suggested as an imaging processing method in the related art (for example, refer to PTL 1). In the method, an image is selected that is used in generation of a composite image by an optimization process in which positioning precision is weighted.